package com.ld.security.common.mybatis.util;

import lombok.Data;

import java.util.LinkedList;
import java.util.List;

/**
 *  0 0 代表被合并
 *  1 1 代表没相同的
 *  2(大于2 的) 1 代表合并
 */
@Data
public class GroupColumn {

    private int rowspan=1;

    private int colspan=1;



    /**
     * 合并下一列并下一列
     * @return
     */
    public GroupColumn incrRowspan(){
        this.rowspan++;
        GroupColumn val = new GroupColumn();
        val.setColspan(0);
        val.setRowspan(0);
        return val;
    }

    public List<GroupColumn> incrRowspan(int i){
        List<GroupColumn> vs = new LinkedList<>();
         while(i > 0){
            GroupColumn vo =  incrRowspan();
            vs.add(vo);
        }
        return vs;
    }



}
